<template>
    <div class="messages" v-if="isInput">
        <div class="alert-message" :class="[{ 'alert-message-back': messageTitle === '' }]">
            <h3>{{$t("translate83")}}</h3>

            <div >
                <p class="message-p">{{$t("translate84")}}</p>
                <!-- <p class="message-p">2.{{ $t("updatetext2") }}</p>
                <p class="message-p">3.{{ $t("updatetext3") }}</p> -->
            </div>
            <!-- <div style="text-align: center" class="messipt">
                <input type="text" :placeholder="$t('inputUserName')" class="ipt" v-model="inputName"
                    style="margin: 0 auto; font-size: 1.6rem" />
            </div> -->
            <div class="alert-btn">
                <div @click="shadeHide">
                    <p>{{$t("translate86")}}</p>
                </div>
                <div class="line"></div>
                <div @click="deleteTrue" class="delete">
                    <p>{{$t("translate85")}}</p>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: "cell",
    components: {},
    props: {
        messageTitle: {
            type: String,
            default: "",
        },
        messageText: {
            type: String,
            default: "",
        },
        isUpdate: {
            type: Boolean,
            default: true,
        },
        isInput: {
            type: Boolean,
            default: true,
        },
        clickFlag: {
            type: Number,
            default: 1,
        },
    },
    data () {
        return {
            center: false,
            detailDom: "",
            inputName: "",
            // isInput: true,
        };
    },
    methods: {
        shadeHide () {
            this.$emit("shadeHide");
        },
        deleteTrue () {
            this.$emit("deleteTrue");
        },
        showDetailBtnFun () {
            if (this.isUpdate === false) {
                this.$nextTick(() => {
                    this.detailDom = this.$refs.detailDom;
                    if (this.detailDom.clientHeight < 30) {
                        this.center = true;
                    } else {
                        this.center = false;
                    }
                });
            }
        },
    },
    mounted () {
        // this.showDetailBtnFun();
    },
};
</script>

<style scoped >
@media only screen and (min-width: 600px) and (max-width:800px) {
    .alert-message {
        left: calc(25% + 0.9rem) !important;
        right: calc(25% + 0.9rem) !important;
        bottom: 50% !important;
        transform: translateY(50%);
    }
}

@media only screen and (min-width:800px) {
    .alert-message {
        left: calc(25% + 1.2rem) !important;
        right: calc(25% + 1.2rem) !important;
        bottom: 50% !important;
        transform: translateY(50%);
    }
}

.messages {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    z-index: 199999991;
    background: rgba(0, 0, 0, 0.2);
}

.alert-message {
    position: fixed;
    bottom: 1.6rem;
    left: 1.2rem;
    right: 1.2rem;
    background: #ffffff;
    border-radius: 2.4rem;
    z-index: 111;
    transition: all 0.5s;
    -webkit-animation: actionsheet 400ms ease-in-out 0ms;
    animation: actionsheet 400ms ease-in-out 0ms;
    color: #000;
}

.alert-message h3 {
    font-size: 2rem;
    font-weight: normal;
    height: 2.6rem;
    line-height: 2.6rem;
    padding: 1.5rem 2.4rem 1.5rem 2.4rem;
}

.alert-message .messipt {
    margin: 0.4rem 0;
}

/* .alert-message-back {
  padding-top: 2.4rem;
} */

.alert-message .message-p {
    font-size: 1.6rem;
    line-height: 2.2rem;
    min-height: 2.2rem;
    color: rgba(0, 0, 0, 0.9);
    text-align: left;
    box-sizing: border-box;
    padding: 0 2.4rem;
}

.alert-message .message-center {
    text-align: center;
}

.alert-btn {
    display: flex;
    color: #0a59f7;
    font-size: 1.6rem;
    height: 5.6rem;
    justify-content: center;
    text-align: center;
    line-height: 5.6rem;
    margin-top: 0.8rem;
}

.alert-btn div {
    font-weight: 400;
    height: 4rem;
    width: 14.4rem;
    font-size: 1.6rem;
    text-align: center;
    line-height: 4rem;
}

.alert-btn div p {
    width: 100%;
    height: 4rem;
    line-height: 4rem;
    border-radius: 0.3rem;
}

#app .alert-btn div .delete {
    color: #fa2a2d !important;
}

.disabled {
    opacity: 0.38 !important;
    pointer-events: none;
}

.alert-btn div p:active {
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

@keyframes actionsheet {
    0% {
        bottom: -100%;
    }

    to {
        bottom: 1rem;
    }
}

.line {
    width: 1px;
    height: 2.4rem !important;
    position: relative;
    top: 0.8rem;
    flex: 0 !important;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 0.8rem;
}

.line::after {
    content: "";
    width: 200%;
    height: 200%;
    position: absolute;
    left: 0;
    background: rgba(0, 0, 0, 0.2);
    top: 0;
    border-right: 0.05rem solid rgba(0, 0, 0, 0.2);
    transform: scale(0.5, 0.5);
    transform-origin: top left;
}

.dark .line::after {
    content: "";
    width: 200%;
    height: 200%;
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.5);
    transform-origin: top left;
}

.dark .messages {
    background: rgba(0, 0, 0, 0.4);
}

.dark .alert-message {
    background: var(--emui_popup_bg);
}

.dark .alert-message h3 {
    color: rgba(255, 255, 255, 0.9);
}

.dark .alert-message .message-p {
    color: rgba(255, 255, 255, 0.86);
}

#app .dark .alert-btn div .delete {
    color: #d94838 !important;
}

.dark .alert-btn {
    color: #5291ff;
}

input {
    width: calc(100% - 4.8rem);
    height: 4.8rem;
    /* background: #f6f7f7; */
    /* border-radius: 2.4rem; */
    opacity: 1;
    border: 0;
    border-bottom: 0.025rem solid #e6e6e6;
    margin-left: 2.6rem;
    /* text-indent: 2.2rem; */
}

.dark input {
    background: var(--emui_popup_bg);
    border-bottom: 0.025rem solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}
.delete {
    color: #fa2a2d !important;
}
</style>
